Optimal. Leaf size=150 \[ \frac {b^4 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {4 a b^3 \cos (c+d x)}{d}-\frac {4 a^3 b \cos ^3(c+d x)}{3 d}+\frac {4 a b^3 \cos ^3(c+d x)}{3 d}+\frac {a^4 \sin (c+d x)}{d}-\frac {b^4 \sin (c+d x)}{d}-\frac {a^4 \sin ^3(c+d x)}{3 d}+\frac {2 a^2 b^2 \sin ^3(c+d x)}{d}-\frac {b^4 \sin ^3(c+d x)}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 150, normalized size of antiderivative = 1.00, number of steps
used = 14, number of rules used = 8, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3169, 2713,
2645, 30, 2644, 2672, 308, 212} \begin {gather*} -\frac {a^4 \sin ^3(c+d x)}{3 d}+\frac {a^4 \sin (c+d x)}{d}-\frac {4 a^3 b \cos ^3(c+d x)}{3 d}+\frac {2 a^2 b^2 \sin ^3(c+d x)}{d}+\frac {4 a b^3 \cos ^3(c+d x)}{3 d}-\frac {4 a b^3 \cos (c+d x)}{d}-\frac {b^4 \sin ^3(c+d x)}{3 d}-\frac {b^4 \sin (c+d x)}{d}+\frac {b^4 \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 212
Rule 308
Rule 2644
Rule 2645
Rule 2672
Rule 2713
Rule 3169
Rubi steps
\begin {align*} \int \sec (c+d x) (a \cos (c+d x)+b \sin (c+d x))^4 \, dx &=\int \left (a^4 \cos ^3(c+d x)+4 a^3 b \cos ^2(c+d x) \sin (c+d x)+6 a^2 b^2 \cos (c+d x) \sin ^2(c+d x)+4 a b^3 \sin ^3(c+d x)+b^4 \sin ^3(c+d x) \tan (c+d x)\right ) \, dx\\ &=a^4 \int \cos ^3(c+d x) \, dx+\left (4 a^3 b\right ) \int \cos ^2(c+d x) \sin (c+d x) \, dx+\left (6 a^2 b^2\right ) \int \cos (c+d x) \sin ^2(c+d x) \, dx+\left (4 a b^3\right ) \int \sin ^3(c+d x) \, dx+b^4 \int \sin ^3(c+d x) \tan (c+d x) \, dx\\ &=-\frac {a^4 \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,-\sin (c+d x)\right )}{d}-\frac {\left (4 a^3 b\right ) \text {Subst}\left (\int x^2 \, dx,x,\cos (c+d x)\right )}{d}+\frac {\left (6 a^2 b^2\right ) \text {Subst}\left (\int x^2 \, dx,x,\sin (c+d x)\right )}{d}-\frac {\left (4 a b^3\right ) \text {Subst}\left (\int \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}+\frac {b^4 \text {Subst}\left (\int \frac {x^4}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=-\frac {4 a b^3 \cos (c+d x)}{d}-\frac {4 a^3 b \cos ^3(c+d x)}{3 d}+\frac {4 a b^3 \cos ^3(c+d x)}{3 d}+\frac {a^4 \sin (c+d x)}{d}-\frac {a^4 \sin ^3(c+d x)}{3 d}+\frac {2 a^2 b^2 \sin ^3(c+d x)}{d}+\frac {b^4 \text {Subst}\left (\int \left (-1-x^2+\frac {1}{1-x^2}\right ) \, dx,x,\sin (c+d x)\right )}{d}\\ &=-\frac {4 a b^3 \cos (c+d x)}{d}-\frac {4 a^3 b \cos ^3(c+d x)}{3 d}+\frac {4 a b^3 \cos ^3(c+d x)}{3 d}+\frac {a^4 \sin (c+d x)}{d}-\frac {b^4 \sin (c+d x)}{d}-\frac {a^4 \sin ^3(c+d x)}{3 d}+\frac {2 a^2 b^2 \sin ^3(c+d x)}{d}-\frac {b^4 \sin ^3(c+d x)}{3 d}+\frac {b^4 \text {Subst}\left (\int \frac {1}{1-x^2} \, dx,x,\sin (c+d x)\right )}{d}\\ &=\frac {b^4 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {4 a b^3 \cos (c+d x)}{d}-\frac {4 a^3 b \cos ^3(c+d x)}{3 d}+\frac {4 a b^3 \cos ^3(c+d x)}{3 d}+\frac {a^4 \sin (c+d x)}{d}-\frac {b^4 \sin (c+d x)}{d}-\frac {a^4 \sin ^3(c+d x)}{3 d}+\frac {2 a^2 b^2 \sin ^3(c+d x)}{d}-\frac {b^4 \sin ^3(c+d x)}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.03, size = 181, normalized size = 1.21 \begin {gather*} \frac {-12 a b \left (a^2+3 b^2\right ) \cos (c+d x)+\left (-4 a^3 b+4 a b^3\right ) \cos (3 (c+d x))-12 b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )+12 b^4 \log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+9 a^4 \sin (c+d x)+18 a^2 b^2 \sin (c+d x)-15 b^4 \sin (c+d x)+a^4 \sin (3 (c+d x))-6 a^2 b^2 \sin (3 (c+d x))+b^4 \sin (3 (c+d x))}{12 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.28, size = 116, normalized size = 0.77
method | result | size |
derivativedivides | \(\frac {\frac {a^{4} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}-\frac {4 a^{3} \left (\cos ^{3}\left (d x +c \right )\right ) b}{3}+2 a^{2} b^{2} \left (\sin ^{3}\left (d x +c \right )\right )-\frac {4 a \,b^{3} \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}+b^{4} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) | \(116\) |
default | \(\frac {\frac {a^{4} \left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{3}-\frac {4 a^{3} \left (\cos ^{3}\left (d x +c \right )\right ) b}{3}+2 a^{2} b^{2} \left (\sin ^{3}\left (d x +c \right )\right )-\frac {4 a \,b^{3} \left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )}{3}+b^{4} \left (-\frac {\left (\sin ^{3}\left (d x +c \right )\right )}{3}-\sin \left (d x +c \right )+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )}{d}\) | \(116\) |
norman | \(\frac {-\frac {8 a^{3} b +16 a \,b^{3}}{3 d}+\frac {2 \left (a^{4}-b^{4}\right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 \left (a^{4}-b^{4}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {8 a^{3} b \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 \left (5 a^{4}+24 a^{2} b^{2}-13 b^{4}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {2 \left (5 a^{4}+24 a^{2} b^{2}-13 b^{4}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {4 \left (2 a^{3} b +16 a \,b^{3}\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {2 \left (4 a^{3} b +8 a \,b^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{4}}+\frac {b^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {b^{4} \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(272\) |
risch | \(-\frac {{\mathrm e}^{i \left (d x +c \right )} a^{3} b}{2 d}-\frac {3 \,{\mathrm e}^{i \left (d x +c \right )} a \,b^{3}}{2 d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a^{4}}{8 d}-\frac {5 i {\mathrm e}^{-i \left (d x +c \right )} b^{4}}{8 d}-\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a^{2} b^{2}}{4 d}-\frac {{\mathrm e}^{-i \left (d x +c \right )} a^{3} b}{2 d}-\frac {3 \,{\mathrm e}^{-i \left (d x +c \right )} a \,b^{3}}{2 d}+\frac {3 i {\mathrm e}^{-i \left (d x +c \right )} a^{2} b^{2}}{4 d}-\frac {3 i {\mathrm e}^{i \left (d x +c \right )} a^{4}}{8 d}+\frac {5 i {\mathrm e}^{i \left (d x +c \right )} b^{4}}{8 d}+\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}-\frac {b^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}-\frac {a^{3} b \cos \left (3 d x +3 c \right )}{3 d}+\frac {a \,b^{3} \cos \left (3 d x +3 c \right )}{3 d}+\frac {\sin \left (3 d x +3 c \right ) a^{4}}{12 d}-\frac {\sin \left (3 d x +3 c \right ) a^{2} b^{2}}{2 d}+\frac {\sin \left (3 d x +3 c \right ) b^{4}}{12 d}\) | \(319\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 126, normalized size = 0.84 \begin {gather*} -\frac {8 \, a^{3} b \cos \left (d x + c\right )^{3} - 12 \, a^{2} b^{2} \sin \left (d x + c\right )^{3} + 2 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} a^{4} - 8 \, {\left (\cos \left (d x + c\right )^{3} - 3 \, \cos \left (d x + c\right )\right )} a b^{3} + {\left (2 \, \sin \left (d x + c\right )^{3} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right ) + 6 \, \sin \left (d x + c\right )\right )} b^{4}}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.77, size = 121, normalized size = 0.81 \begin {gather*} -\frac {24 \, a b^{3} \cos \left (d x + c\right ) - 3 \, b^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, b^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 8 \, {\left (a^{3} b - a b^{3}\right )} \cos \left (d x + c\right )^{3} - 2 \, {\left (2 \, a^{4} + 6 \, a^{2} b^{2} - 4 \, b^{4} + {\left (a^{4} - 6 \, a^{2} b^{2} + b^{4}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{6 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \cos {\left (c + d x \right )} + b \sin {\left (c + d x \right )}\right )^{4} \sec {\left (c + d x \right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 217, normalized size = 1.45 \begin {gather*} \frac {3 \, b^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, b^{4} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {2 \, {\left (3 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 12 \, a^{3} b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{4} + 2 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 24 \, a^{2} b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 10 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 24 \, a b^{3} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 3 \, a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 3 \, b^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 4 \, a^{3} b - 8 \, a b^{3}\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{3}}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.75, size = 190, normalized size = 1.27 \begin {gather*} \frac {2\,b^4\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d}-\frac {\frac {16\,a\,b^3}{3}-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^5\,\left (2\,a^4-2\,b^4\right )-{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^3\,\left (\frac {4\,a^4}{3}+16\,a^2\,b^2-\frac {20\,b^4}{3}\right )+\frac {8\,a^3\,b}{3}-\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (2\,a^4-2\,b^4\right )+16\,a\,b^3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+8\,a^3\,b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4}{d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+3\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________